/************************************************************************/
/*																		*/
/*		School Hangover Project											*/
/*																		*/
/*		IMAC 2010														*/
/*		Author : 	Helena Duchaussoy									*/
/*					Isabelle Gouwy										*/
/*					Nathalie Kuoch										*/
/*					Franck Letellier									*/
/*					Louise Pequignot									*/
/*																		*/
/*		E-mail: flo-in-underware@googlegroups.com						*/
/*																		*/
/************************************************************************/
#ifndef __CLOTH_H__
#define __CLOTH_H__

#include "InteractiveObject.h"
#include "Player.h"
#include "Hud.h"


class Cloth : public InteractiveObject {

public:
	Cloth();
	Cloth(lua_State* L);
	~Cloth();

	void update();

	void init();

	int load(lua_State* L);
	int setImg(lua_State* L);
	int setClothID(lua_State* L);
	
	inline std::string getImg() {return m_simgFile;}
	inline int getClothID() {return m_iclothID;}

	inline bool getUnlocked() {return m_bunlocked;}
	inline bool getRemove() {return m_bremove;}

	inline void setUnlocked(bool unlock) {m_bunlocked = unlock;}
	inline void setRemove(bool rem) {m_bremove = rem;}

private:
	int m_iclothID;
	bool m_bunlocked;

	std::string m_simgFile;
	bool m_bremove;

	KeyboardState* m_pkeyState;

	friend class Lunar<Cloth>;
	static const char className[];
	static Lunar<Cloth>::RegType methods[];

};

// Callback class to handle keyboard event
class ClothActionCallback : public osg::NodeCallback {

public:
	ClothActionCallback(KeyboardState* keyState, Cloth* cloth) {
		m_pkeyState = keyState;
		m_pcloth = cloth;
	}

	virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);

protected:
	KeyboardState* m_pkeyState;
	Cloth* m_pcloth;
};

#endif // __CLOTH_H__
